#ifndef __LCD_H
#define __LCD_H
#define LCD_EN                GPIO_Pin_9     // PC13              
#define LCD_RS                GPIO_Pin_8     //PE14  
#define LCD_RW                GPIO_Pin_15     // PE15              
#define LCD_RST               GPIO_Pin_14     // PC12               
#define LCD_CS                GPIO_Pin_13     // PE12
#define LCD_DIR1              GPIO_Pin_1     //PC15
#define LCD_DIR2              GPIO_Pin_12     //PE12
#define LCD_Data_Port         GPIOE

#define LCD_RST_DISABLE           GPIOB->BSRR = LCD_RST
#define LCD_RST_ENABLE            GPIOB->BRR  = LCD_RST
#define LCD_EN_DISABLE            GPIOD->BRR  = LCD_EN
#define LCD_EN_ENABLE             GPIOD->BSRR = LCD_EN
#define LCD_RS_DATA               GPIOD->BSRR = LCD_RS
#define LCD_RS_CMD                GPIOD->BRR  = LCD_RS
#define LCD_RW_WR                 GPIOB->BRR  = LCD_RW
#define LCD_RW_RD                 GPIOB->BSRR = LCD_RW
#define LCD_CS_RIGHT              GPIOB->BSRR = LCD_CS
#define LCD_CS_LEFT               GPIOB->BRR  = LCD_CS
#define MCU_LCD                   GPIOA->BRR  = LCD_DIR1
#define LCD_MCU                   GPIOA->BSRR = LCD_DIR1

#define LCD_PAGE                  0xB8
#define LCD_X                     0xC0
#define LCD_Y                     0x40

void Lcd_Nc(void);
void Lcd_IO_Init(void);
void Lcd_reset(void);
unsigned char Check_Lcd_Busy(void);
void Write_Lcd(unsigned char dat_comm, unsigned char content);
unsigned char Read_Lcd(void);
void Read_Status(void);
void Lcd_Disp_OneByte(unsigned char Byte,unsigned char Row,unsigned char Col);
#endif